<?php

//1. 获取code
$code = $_GET["code"];
//2. 从session中取出code
session_start();
$codeOrigin = $_SESSION["code"];
//3. 比对
if ($codeOrigin == $code) {
  echo json_encode(["code" => 200, "msg" => "验证码正确"], JSON_UNESCAPED_UNICODE);
} else {
  echo json_encode(["code" => 0, "msg" => "验证码错误"], JSON_UNESCAPED_UNICODE);
}
